Skip to content

Conversation

barbaraperic
Copy link
Collaborator

@barbaraperic barbaraperic commented Oct 16, 2025

Description

  • Refactored the upload progress logic to clarify the conceptual hierarchy between steps, stages, and the overall upload process (mainly in the use-upload-progress hook and components)
  • The goal was to make the data model, naming, and types more expressive and consistent across the codebase — improving readability, type safety, and maintainability.

Key Changes

  1. Clarified the data model
  • Step → the smallest unit of work (creating-car, announcing-cids, etc.)

  • Stage → a logical grouping of one or more steps
    (e.g., first stage = creating-car, checking-readiness, uploading-car)

  • Upload → the complete process made up of all stages

Defined explicit StepState, StageState, and UploadState types to reflect this structure.

  1. Split types into modular files
  • Moved upload-related types and util functions into a dedicated src/types/upload/ and src/utils/upload/ directory:
  1. Renamed ambiguous variables and functions
  • progressesstepStates to reflect that these hold full step state objects, not just progress values.

  • calculateCompletionStates → getUploadOutcome for clearer intent.

  • getStageBadgeStatus → getUploadBadgeStatus since the badge reflects overall upload state, not an individual stage.

  1. Added explicit badge-status logic to reflect publishing progress more accurately:

In progress - During:

  • 'creating-car' in progress
  • 'uploading-car' in progress
  • 'checking-readiness' in progress
  • 'announcing-cids' in progress
  • 'finalizing-transaction' in progress

Published - When:

  • 'finalizing-transaction' is completed BUT 'announcing-cids' is not yet completed

Pinned - When:

  • Both 'finalizing-transaction' AND 'announcing-cids' are completed

@barbaraperic barbaraperic self-assigned this Oct 16, 2025
…ndling

This update transitions the upload progress management from using the Progress type to the new StepState type, enhancing type safety and clarity. The changes include updates to various components and hooks to accommodate the new structure, ensuring consistent handling of upload steps and statuses throughout the application.
Copy link

vercel bot commented Oct 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
filecoin-pin-website Error Error Oct 20, 2025 2:45pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant